<?php
/**
 *MiniProgramLoginValidate
 * @author tan bing
 * @date 2021-08-11 12:46
 */
namespace Modules\User\Validate\Api;

use Modules\User\Validate\BaseValidate;

class MiniProgramLoginValidate extends BaseValidate
{

    protected $rule = [
        'code' => 'required',
        'nickname' => 'required',
        'avatar_url' => 'required',
        'gender' => 'required|integer',
    ];

    protected $message = [
        'code.required' => 'code不能为空',
        'nickname.required' => '昵称不能为空',
        'avatar_url.required' => '头像不能为空',
        'gender.required' => '性别不能为空',
        'gender.integer' => '性别参数错误',
    ];

    protected $scene = [
        'login' => ['code'],
        'register' => ['code', 'nickname', 'avatar_url', 'gender'],
    ];
}